fix: remove ^orphan_file ext4 flag unsupported by older e2fsprogs#2192
Conversation
Production orchestrators run e2fsprogs < 1.47.0 which does not recognize the orphan_file feature. Passing ^orphan_file to mkfs.ext4 on these older versions causes an "Invalid filesystem option set" error because the feature is entirely unknown, not just unsupported. Since orphan_file is only a default in e2fsprogs >= 1.47.0. Fixes: 5adcb7a ("feat: reserve disk space for guest OS during template build (#2082)")
| // guest tools fail with "unsupported read-only feature(s)". | ||
| // See https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 | ||
| "^orphan_file", | ||
| }, ","), |
There was a problem hiding this comment.
Removing ^orphan_file entirely fixes the host-side error on e2fsprogs < 1.47.0, but reintroduces the original problem that PR #2082 was solving: on hosts with e2fsprogs >= 1.47.0, orphan_file will now be enabled by default in the filesystem, causing older guests (Ubuntu 22.04, Debian 11) to fail with unsupported read-only feature(s). The safe fix would be to detect host e2fsprogs version at runtime and conditionally pass ^orphan_file only when >= 1.47.0, or to use tune2fs -O ^orphan_file post-creation (which may handle the unknown-feature case more gracefully). As-is, this is a regression for anyone running newer e2fsprogs on the host with older-e2fsprogs guests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a75a20d35
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "sparse_super2", | ||
|
|
||
| // Disabled for compatibility with older guest e2fsprogs (Ubuntu 22.04, Debian 11). | ||
| // orphan_file was added as default in e2fsprogs >= 1.47.0; without disabling it, | ||
| // guest tools fail with "unsupported read-only feature(s)". | ||
| // See https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 | ||
| "^orphan_file", | ||
| }, ","), |
There was a problem hiding this comment.
Keep
orphan_file disabled when building on newer hosts
If build-reserved-disk-space-mb is enabled and this runs on a builder whose mkfs.ext4 defaults orphan_file back on, the filesystem becomes unreadable to older guest tune2fs binaries again. We still run tune2fs -r /dev/vda inside the sandbox during post-processing (packages/orchestrator/pkg/template/build/phases/finalize/builder.go:222-230, packages/orchestrator/pkg/template/build/sandboxtools/command.go:237-263), so those builds will start failing with unsupported read-only feature(s) as soon as a newer e2fsprogs host is introduced. This fixes the current old-host mkfs.ext4 error by making the image feature set host-version-dependent again.
Useful? React with 👍 / 👎.
jakubno
left a comment
There was a problem hiding this comment.
Fix for all version coming later
Production orchestrators run e2fsprogs < 1.47.0 which does not recognize the
orphan_filefeature. Passing^orphan_filetomkfs.ext4on these older versions causes an "Invalid filesystem option set" error because the feature is entirely unknown, not just unsupported. Since orphan_file is only a default ine2fsprogs>= 1.47.0.Fixes: 5adcb7a ("feat: reserve disk space for guest OS during template build (#2082)")
Note
Low Risk
Low risk change limited to template filesystem creation flags; main impact is ext4 feature set selection during
mkfs.ext4runs.Overview
Removes the
^orphan_filefeature toggle from themkfs.ext4invocation during template ext4 creation so template builds work with older e2fsprogs versions whereorphan_fileis an unknown option and would otherwise causemkfs.ext4to fail.Written by Cursor Bugbot for commit 4a75a20. This will update automatically on new commits. Configure here.